home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 2 / ACE CD 2.iso / FILES / UTILS / AMOSPRO5.DMS / in.adf / Equates / Editor_Commands.Doc < prev    next >
Encoding:
Text File  |  1993-03-10  |  10.5 KB  |  434 lines

  1.  
  2.  
  3.                       AMOS Professional Editor Commands
  4.  
  5.                          Documentation by F.Lionet
  6.  
  7.                   Copyright (c) 1993 Europress Software 1993
  8.  
  9.  
  10.  
  11.                                 Introduction
  12.  
  13.  
  14. The AMOSPro editor contains many advanced features. One of them is the
  15. ability to launch AMOS programs as accessories.
  16.  
  17. To be an accessory a program has to respect a few rules:
  18.  
  19. - The SET ACCESSORY command must be used within the sourcecode
  20. - The  program  must  be  launched from the AMOS menu, or assigned to a key
  21.   shortcut.
  22. - It must not be the currently edited program.
  23.  
  24. If  the  above conditions are respected the program will have full access to
  25. the  source  code  of the current program.  This means it can edit the file,
  26. save  it  or  do whatever necessary with it.  It even has full access to the
  27. editor screen, and can even display into it!
  28.  
  29. This system is incredibly powerful. Almost anything is possible.
  30.  
  31. A few example ideas:
  32.  
  33. - A  palette  generator:   instead of typing in the colours by hand, call a
  34.   palette accessory then select the colours with the mouse.  Upon quitting the
  35.   accessory,  the  'Palette'  instruction  with the correct colours is created
  36.   into the source!
  37.  
  38. - Source analyser, list out all procedure names, cross reference variable
  39.   list etc.
  40.  
  41. - An interface between the AMOSPro editor and AREXX:  The accessory gets
  42.   AREXX messages and transforms them into editor commands.
  43.  
  44. - An adventure generator
  45.  
  46. - The retokeniser is a good example: have a look at it.
  47.  
  48. - etc, etc.
  49.  
  50.  
  51.  
  52.                              How does it work?
  53.  
  54. Once  your  program  is  called  as  an  accessory,  it  can use two AMOSPro
  55. instructions:  Ask Editor and Call Editor.
  56.  
  57. Optional  parameters  returned  by  the  editor  will be found in =Param and
  58. =Param$.
  59.  
  60. All the editor calls are defined in AMOSPro_System_Equate file.  You'll need
  61. to use the =Equ("") instruction to get the correct value.
  62.  
  63. * Call Editor FUNCTION [,PAR][,PAR$]
  64.  
  65. This  instruction is used to send commands to the editor.  It acts just like
  66. a  TV  remote  controler:   making the editor cursor move, opening a window
  67. etc.
  68.  
  69. FUNCTION:  the number of the function to be called, must begin with "AEd_"
  70. PAR:   an  optional integer parameter, usually for requester simulated input
  71. (stated for each function).
  72. PAR$:  an optional string parameter, for example a file name.
  73.  
  74.  
  75. * Ask Editor FUNCTION [,PAR][,PAR$]
  76.  
  77. As  the  name  implies, this instruction is used to get information from the
  78. editor.
  79.  
  80. FUNCTION: the number of the function to be called. Must begin with "AEdAsk_"
  81. PAR: the optional integer parameter
  82. PAR$: the optional string parameter.
  83.  
  84.  
  85.  
  86.                          The "Ask Editor" Commands.
  87.  
  88. Any integer parameter is returned in =Param
  89. Any string is returned in =Param$
  90.  
  91. AEdAsk_CurrentLine (1)
  92. * Returns the current line (under the cursor)
  93. * No parameter
  94.  
  95. AEdAsk_ProgramName (2)
  96. * Returns the name of the current program
  97. * No parameter
  98.  
  99. AEdAsk_X (3)
  100. * Returns the current cursor's X position
  101. * No parameter
  102.  
  103. AEdAsk_Y (4)
  104. * Returns the current cursor's Y position
  105. * No parameter
  106.  
  107. AEdAsk_NumberOfLines (5)
  108. * Returns the number of lines of the current program
  109. * No parameter
  110.  
  111. AEdAsk_BlocX1 (6)
  112. * Returns the X position of the start of the highlighted block (if defined)
  113. * No parameter
  114.  
  115. AEdAsk_BlocY1 (7)
  116. * Returns the Y position of the start of the highlighted block (if defined)
  117. * No parameter
  118.  
  119. AEdAsk_BlocY2 (8)
  120. * Returns the X position of the end of the highlighted block (if defined) 
  121. * No parameter
  122.  
  123. AEdAsk_BlocY2 (9)
  124. * Returns the Y position of the end of the highlighted block (if defined) 
  125. * No parameter
  126.  
  127. AEdAsk_Free (10)
  128. * Returns the amount of free buffer space.
  129. * No parameter
  130.  
  131. AEdAsk_Struc (11)
  132. * Internal use only
  133.  
  134. AEdAsk_Token (12)
  135. * Tokenise the given ASCII String into AMOS source code, and returns a
  136.   pointer to a buffer containing the tokenised code.
  137. * PAR$= string to tokenise.
  138.  
  139.  
  140.                             The editor commands
  141.  
  142. After the command has been called:
  143.  
  144. =Param contains the error state:  0 if no error, <>0 if an error occured.
  145.  
  146. =Param$  is empty if no errors occured, and contains the error message if an
  147. error occured.
  148.  
  149. AEd_Up (1)
  150. * Moves the cursor up one line
  151.  
  152. AEd_Down (2)
  153. * Moves the cursor down one line.
  154.  
  155. AEd_Left (3)
  156. * Moves the cursor left one character.
  157.  
  158. AEd_Right (4)
  159. * Moves the cursor right one character.
  160.  
  161. AEd_TopPage (5)
  162. * Moves the cursor to the top of the current window.
  163.  
  164. AEd_BottomPage (6)
  165. * Move the cursor to the bottom of the current window.
  166.  
  167. AEd_WordLeft (7)
  168. * Move the cursor to the beginning of the previous word.
  169.  
  170. AEd_WordRight (8)
  171. * Move the cursor to the beginning of the next word.
  172.  
  173. AEd_PageUp (9)
  174. * Move the cursor up one page in the text.
  175.  
  176. AEd_PageDown (10)
  177. * Move the cursor down one page in the text.
  178.  
  179. AEd_StartLine (11)
  180. * Move the cursor to the start of the current line.
  181.  
  182. AEd_EndLine (12)
  183. * Move the cursor to the end of the current line.
  184.  
  185. AEd_WindowUp (13)
  186. * Moves the current window up.
  187.  
  188. AEd_WindowDown (14)
  189. * Moves the current window down.
  190.  
  191. AEd_WindowSmaller (15)
  192. * Reduce the size of the current window.
  193.  
  194. AEd_WindowBigger (16)
  195. * Increase the size of the current window.
  196.  
  197. AEd_TopOfText (17)
  198. * Move the cursor to the top of the text. 
  199.  
  200. AEd_BottomOfText (18)
  201. * Move the cursor to the end of the text.
  202.  
  203. AEd_Return (19)
  204. * Performs a <RETURN> 
  205.  
  206. AEd_BackSpace (20)
  207. * Performs a <BACKSPACE>: delete one character to the left of the cursor.
  208.  
  209. AEd_Delete (21)
  210. * Performs a <DELETE>: delete one character to the right of the cursor.
  211.  
  212. AEd_ClrLine (22)
  213. * Clears the entire current line.
  214.  
  215. AEd_DelLine (23)
  216. * Delete the current line, and scroll up the rest of the text <CONTROL-Y>
  217.  
  218. AEd_Tab (24)
  219. * Insert one tab <TAB>
  220.  
  221. AEd_SetTab (25)
  222. * Set the current tab value.
  223. * PAR= new tab value.
  224.  
  225. AEd_InsertLine (29)
  226. * Insert one empty line at the current cursor position <F10>
  227.  
  228. AEd_DelToEndOfLine (30)
  229. * Delete to the end of the current line <CONTROL-DEL>
  230.  
  231. AEd_PreviousLabel (31)
  232. * Go to previous label.
  233.  
  234. AEd_NextLabel (32)
  235. * Go to next label.
  236.  
  237. AEd_Load (33)
  238. * Load a new program in the current window.
  239. * PAR$= filename of the program to load.
  240. * PAR= answer to the requester "Program not saved, save it?"
  241. 0= CANCEL / 1=YES / 2=NO
  242.  
  243. AEd_SaveAs (34)
  244. * Save the current program with a new name.
  245. * PAR$= new filename.
  246.  
  247. AEd_Save (35)
  248. * Save the current program.
  249. * PAR$= optional name if program is not named.
  250.  
  251. AEd_DelWordRight (36)
  252. * Delete the word to the right of the cursor.
  253.  
  254. AEd_DelWordLeft (37)
  255. * Delete the word to the left of the cursor.
  256.  
  257. AEd_Hide (38)
  258. * Hide the current program.
  259.  
  260. AEd_SetSystemMark1 (39)
  261. * Set system mark number 1
  262.  
  263. AEd_SetSystemMark2 (40)
  264. * Set system mark number 2.
  265.  
  266. AEd_SetSystemMark3 (41)
  267. * Set system mark number 3.
  268.  
  269. AEd_SetMark1 (42)
  270. * Set mark number 1.
  271.  
  272. AEd_SetMark2 (43)
  273. * Set mark number 2.
  274.  
  275. AEd_SetMark3 (44)
  276. * Set mark number 3.
  277.  
  278. AEd_SetMark4 (45)
  279. * Set mark number 4.
  280.  
  281. AEd_SetMark5 (46)
  282. * Set mark number 5.
  283.  
  284. AEd_SetMark6 (47)
  285. * Set mark number 6.
  286.  
  287. AEd_GotoSystemMark1 (49)
  288. * Move the cursor to the system mark number 1.
  289.  
  290. AEd_GotoSystemMark2 (50)
  291. * Move the cursor to the system mark number 2.
  292.  
  293. AEd_GotoSystemMark3 (51)
  294. * Move the cursor to the system mark number 3.
  295.  
  296. AEd_GotoMark1 (52)
  297. * Move the cursor to the mark number 1.
  298.  
  299. AEd_GotoMark2 (53)
  300. * Move the cursor to the mark number 2.
  301.  
  302. AEd_GotoMark3 (54)
  303. * Move the cursor to the mark number 3.
  304.  
  305. AEd_GotoMark4 (55)
  306. * Move the cursor to the mark number 4.
  307.  
  308. AEd_GotoMark5 (56)
  309. * Move the cursor to the mark number 5.
  310.  
  311. AEd_GotoMark6 (57)
  312. * Move the cursor to the mark number 6.
  313.  
  314. AEd_BlocOnOff (59)
  315. * Toggle the block mode on/off.
  316.  
  317. AEd_Forget (60)
  318. * Forget the currently stored block.
  319.  
  320. AEd_OpenLoad (61)
  321. * Opens a new window, and loads the specified program into it. 
  322. * PAR$= file name to load
  323. * PAR= answer to "Buffer to small" requester. 0=NO / 1=YES
  324.  
  325. AEd_BlocCut (62)
  326. * Cut the currently highlighted block.
  327.  
  328. AEd_BlocPaste (63)
  329. * Paste the currently stored block.
  330.  
  331. AEd_DelToStartOfLine (64)
  332. * Delete to the start of the current line.
  333.  
  334. AEd_Undo (65)
  335. * Performs one step of UNDO.
  336.  
  337. AEd_Search (66)
  338. * Initialise the search process. Search does NOT begin after this 
  339.   instruction, you should call AEd_SearchNext ou AEd_SearchPrevious.
  340. * PAR$= string to look for (31 char maximum).
  341. * PAR=0: lower<>upper, PAR=1 lower=upper.
  342.  
  343. AEd_SearchNext (67)
  344. * Search for the next occurence of the string.
  345.  
  346. AEd_SearchPrevious (68)
  347. * Search for the previous occurence of the string.
  348.  
  349. AEd_ChangeLine (69)
  350. * Replace the current line with the specified one. Does NOT tokenise 
  351. the line or store it into the text buffer. This line will be 
  352. tonkenised automatically if the cursor is moved.
  353. * PAR$= new string to force into the screen.
  354.  
  355. AEd_NewLine (71)
  356. * Replace the current line on the screen and tokenise it. Then redisplays
  357. the tokenised line (which may differ).
  358. * PAR$= new string to force into the text.
  359.  
  360. AEd_BlocStore (72)
  361. * Stores the highlighted block into memory.
  362.  
  363. AEd_Clear (80)
  364. * New the current program.
  365. * PAR= answer to "Program not saved, save?" requester. 0=CANCEL / 1=YES / 2=NO
  366.  
  367. AEd_Close (81)
  368. * Close the current window.
  369. * PAR= answer to "Program not saved, save?" requester. 0=CANCEL / 1=YES / 2=NO
  370.  
  371. AEd_Merge (84)
  372. * Merge a program from disc with the current one, at the cursor's position.
  373. * PAR$= name of the program to merge.
  374.  
  375. AEd_MergeAscii (85)
  376. * Merge an ascii text at the cursor's position.
  377. * PAR$= name of the file to merge.
  378.  
  379. AEd_BlocPrint (86)
  380. * Print the currently stored block.
  381.  
  382. AEd_UnfoldAll (89)
  383. * Open all closed procedures.
  384.  
  385. AEd_WindowPrev (91)
  386. * Activate previous window.
  387.  
  388. AEd_WindowNext (92)
  389. * Activate next window.
  390.  
  391. AEd_WindowToggle (93)
  392. * Toggle the size of the window (large or small).
  393.  
  394. AEd_Redo (94)
  395. * Performs one REDO step.
  396.  
  397. AEd_BlocSaveAscii (97)
  398. * Save the currently stored block as an ascii file
  399. * PAR$= name of the file to create
  400.  
  401. AEd_BlocSave (98)
  402. * Saves the currently stored block.
  403. * PAR$= name of the file to create.
  404.  
  405. AEd_Replace (99)
  406. * Initialise the replace string and replace modes. You should first
  407.   call AEd_Search to set the searched string, and the search mode.
  408.   Replace process only begins if TURBO mode is selected, otherwise you
  409.   must call AEd_ReplaceNext or AEd_ReplacePrevious.
  410. * PAR$= string to replace with, 31 characters maximum.
  411. * PAR=0: normal replace, PAR=%0100: turbo within the block, 
  412.   PAR=%1000: turbo for whole text.
  413.  
  414. AEd_ReplaceNext (100)
  415. * Replace next occurence of searched string.
  416.  
  417. AEd_ReplacePrevious (101)
  418. * Replace previous occurence of searched string.
  419.  
  420. AEd_Open (103)
  421. * Opens a new AMOS window.
  422.  
  423. AEd_PrintProgram (146)
  424. * Send the current program to the printer.
  425.  
  426. AEd_HighlightAll (181)
  427. * Highlight all the current text.
  428.  
  429. AEd_ChangeConfig (182)
  430. * Changes one of the editor's internal configuration strings.  Used in
  431.   AMOSPro_Editor_Config.AMOS
  432. * PAR$= new string
  433. * PAR= number of the string to change
  434.